/*
 * @Descripttion: 
 * @version: 1.0.0
 * @Author: Shentong
 * @Date: 2021-01-18 15:27:20
 * @LastEditors: Shentong
 * @LastEditTime: 2021-01-22 18:57:23
 */
import React from 'react'
import { View, Button } from '@tarojs/components'

import styles from './index.module.scss'

export default (props) => {
  const { title, onConfirm, cancelTxt, confirmTxt, ctxTxt, onClose } = props

  return (
    <View className={styles.confirm_box}>
      <View className={styles.alert}>
        <View className={`${styles.header} ${!ctxTxt && styles.no_content}`}> {title} </View>
        <View className={styles.content}>{ ctxTxt }</View>
        <View className={styles.footer}>
          <Button className={`${styles.btn} ${styles.cancel}`} onClick={onClose}>{cancelTxt}</Button>
          <Button className={`${styles.btn} ${styles.confirm}`} onClick={onConfirm}>{confirmTxt}</Button>
        </View>
      </View>
      <View className={styles.bg}></View>
    </View>
  )
}